package com.bjmashibing.system;

import com.bjmashibing.system.huawei.vivo.vivo_push;
import com.bjmashibing.system.huawei.vivo.xiaomi_push;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @Classname test_xiaomi
 * @Description TODO
 * @Date 2020/10/27/027 17:42
 * @Created by Administrator
 */
public class test_xiaomi {
    private final static Logger logger = LoggerFactory.getLogger(test_xiaomi.class);
    public class MyThread implements Runnable{
        int count=3;
        public void run() {
            while(count>0) {
                try {
                    Thread.sleep(200);
                } catch (InterruptedException e) {
                    logger.info("test_xiaomi,error=",e);
                    e.printStackTrace();
                }
                logger.info(Thread.currentThread().getName()+"-当前剩余票数:"+count--);
                try {
//
                    String alias2 = "1JC/eDRYxjPSYfI0l3heX8GhoBMcfGar8QXzEt6H0pqP6TX9ujw8WigknprWj+ZN";
                    xiaomi_push.sendMessageToAlias2(alias2);
                } catch (Exception e) {
                    logger.info("test_xiaomi,error=",e);
                    e.printStackTrace();
                }
            }
        }


    }
    @Test
    public void test() {
        logger.info( "Hello World!" );
        MyThread Thread1=new MyThread();

        Thread1.run();

//        Constants.useOfficial();
     /*   try {
//
            String alias2 = "1JC/eDRYxjPSYfI0l3heX8GhoBMcfGar8QXzEt6H0pqP6TX9ujw8WigknprWj+ZN";
            xiaomi_push.sendMessageToAlias2(alias2);
        } catch (Exception e) {
            e.printStackTrace();
        }*/


    }

    @Test
    public void test2() {
//        String alias2 = "1JC/eDRYxjPSYfI0l3heX8GhoBMcfGar8QXzEt6H0pqP6TX9ujw8WigknprWj+ZN";
        String alias2 = "Rd+PhKWfvifEGq5upVKF5bPCN0SjCxuBgGMaVdHXN5pV59Pr6vA/VantVobp1nZL";
        try {
            xiaomi_push.sendMessageToAlias3(alias2,"全局布防","861232323;|3400 00 000]","861232323","|3400 00 000]");
        } catch (Exception e) {
            logger.info("test2,error=",e);
            e.printStackTrace();
        }
    }

    @Test
    public void test3() {
        try {
            int a = 0;
            int b = 2/a;
        } catch (Exception e) {
//            logger.info("test3,error=" + e.getMessage());
//            logger.info("test3,error=" + e.toString());
            logger.info("test3,error=",e);
//            logger.error("test3,error=", e);
            e.printStackTrace();
        }
    }
}
